# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=wol
pkgver=0.7.1
pkgrel=2
pkgdesc="Wake On LAN functionality in a small program"
url="https://wake-on-lan.sourceforge.io/"
arch="all"
license="GPL-2.0-or-later"
subpackages="$pkgname-doc $pkgname-lang"
source="
	https://downloads.sourceforge.net/project/wake-on-lan/wol/$pkgver/wol-$pkgver.tar.gz
	0001-musl-fixes.patch
	"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--infodir=/usr/share/info
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	rm -rf "$pkgdir"/usr/lib/charset.alias
	rm -rf "$pkgdir"/usr/share/locale/locale.alias
	rmdir -p "$pkgdir"/usr/lib 2>/dev/null || true
}

sha512sums="
233cbd038633c4b04a22710c04a8349d7706c6b4ff0554b6899ee3309349502a318f6fb05a4ad4c80cd373c362b2ad8818cb52a432d768f569e80f05658615a3  wol-0.7.1.tar.gz
993374df9eb3b4968c08cb151656d2e607da88ef94042edda1d4633c782238241a64b4097faabe6dfdb8323a54d58d428a4d4e2adb18c63b1bbb5935a7bdce98  0001-musl-fixes.patch
"
